package comm.suger.web.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.portlet.ModelAndView;

import comm.suger.web.service.AppGService;
import comm.suger.web.service.AppLogService;

@Controller
public class MainController {
	
	@Resource(name="appLogService")
	AppLogService appLogService;
	
	@Resource(name="appGService")
	AppGService appGService;
	
	@RequestMapping(value="/main")
	public ModelAndView main(Model model){
		model.addAttribute("dcount", "1000");//点击量
		model.addAttribute("gcount", "21540");//展示量
		model.addAttribute("allmomey", "215470"); //总收益
		return new ModelAndView("/main");
	}

	
	@RequestMapping(value="/welcome")
	public ModelAndView main2(){  
        ModelAndView mav = new ModelAndView();  
        mav.addObject("message", "Hello World!");
        mav.setViewName("/welcome"); //返回的文件名  
        return mav;  
    }  
}